<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
	<title>txtSQL Documentation</title>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
	<link rel="stylesheet" type="text/css" href="./includes/style.css" />
	<script src="./includes/javascript.js"></script>
</head>
<body>

<table width="96%" cellspacing="0" cellpadding="9" border="0" align="center" class="mainTable">
	<tr>
		<td class="header" colspan="2">
			<table cellspacing="0" cellpadding="0" border="0" width="100%">
				<tr>
					<td align="left">
						<a href="index.html">Home</a>
						&nbsp; &nbsp;<a href="javascript:history.back()">Back</a>
						&nbsp; &nbsp;<a href="javascript:history.forward()">Forward</a>
						&nbsp; &nbsp;<a href="javascript:location.reload()">Refresh</a>
						&nbsp; &nbsp;<a href="http://chibiguy.dotgeek.org/index.php">txtSQL Homepage</a>
					</td>
					<td align="right">
						<a href="http://chibiguy.dotgeek.org/index.php" target="_blank"><img src="includes/txtsql_powered_small.gif" /></a>
					</td>
				</tr>
			</table>
		</td>
	</tr>
	<tr valign="top">
		<td class="mainCell">
			<div class="dashedUnderline"><a href="index.html">txtSQL Documentation</a> > <a  href="7.html">SQL Syntax</a> > UPDATE Syntax</div><br />

			<table width="100%">
				<tr valign="bottom">
					<td align="left">
						<div class="h1">UPDATE Syntax </div>
					</td>
					<td align="right">
						txtSQL >= 3.0.0 Beta					</td>
				</tr>
			</table>

			<br />			<div class="content">
				<b><font color="blue">UPDATE</font></b> [ <i>db.table | table</i> ]<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <font color="blue"><b>WHERE</b></font> <font color="firebrick"><i>WhereClause</i></font><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <b><font color="blue">SET</font></b> ( column1 = value, column2 = value... ) |<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ([column1, column2...]) <b><font color="blue">VALUES</font></b> (column1_value, column2_value...)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [ <font color="blue"><b>LIMIT</b></font> <font color="firebrick"><i>LimitClause</i></font> ]<br /><br />

This statement will allow for a user to update [a] row[s] of information in the table/database combination provided that fit a certain criteria (the WHERE clause).<br /><br />

If a $limit is defined, then txtSQL will stop updating rows and return the number of rows updated at the $limit. NOTE- This limit only needs one value (i.e. array(20) stops at 21 rows) unlike a regular limit clause.<br /><br/>

If a column is of type enum and the value being updated does not exist as one of the enum values, the last value from the enum list is inserted.<br /><br />

<b>NOTE</b>- To have a complete look at the UPDATE function, and any changes to its functionality, see the <a  href="31.html">update() function</a>			</div><br /><br />

			
			
			<TEXTAREA ID="holdtext" STYLE="display: none;"></TEXTAREA>			
			<table class="commentTable">
				<tr>
					<td style="border: 0px solid; margin: 0px; padding: 0px;">
						<table width="100%">
							<tr>
								<td style="border:0px solid;">
									<div class="h1">User Comments - UPDATE Syntax</div>
								</td>
								<td align="right" style="border: 0px solid; padding: 0px; margin: 0px;">
									
								</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td class="row1" align="center">
						No comments posted yet; 
					</td>
				</tr>
			</table>
		</td>

		<td class="sideCell">
		
			<table width="100%" cellspacing="0" cellpadding="0" border="0" class="dashedUnderline">
				<tr>
					<td align="left">
						<a  href="55.html">Last Page</a>					</td>
					<td align="right">
						<a  href="57.html">Next Page</a>					</td>
				</tr>
			</table><br />

			
			<a style="font-weight: bold;"  href="1.html">'Language Reference'</a></b><br />
			<br />

			<a style="font-weight: bold;"  href="13.html">User Functions</a></b><br />
			<br />

			<a style="font-weight: bold;"  href="19.html">Database Functions</a></b><br />
			<br />

			<a style="font-weight: bold;"  href="28.html">Data Manipulation Functions</a></b><br />
			<br />

			<a style="font-weight: bold;"  href="34.html">Table Functions</a></b><br />
			<br />

			<a style="font-weight: bold;"  href="42.html">Error Handling Functions</a></b><br />
			<br />

			<a style="font-weight: bold;"  href="52.html">SQL Syntax</a></b><br />
			<li /> <a  href="53.html">SELECT Syntax</a><br />
			<li /> <a  href="54.html">INSERT Syntax</a><br />
			<li /> <a  href="55.html">DELETE syntax</a><br />
			<li /> <i>UPDATE Syntax</i><br />
			<li /> <a  href="57.html">CREATE DATABASE Syntax</a><br />
			<li /> <a  href="58.html">DROP DATABASE Syntax</a><br />
			<li /> <a  href="59.html">SHOW DATABASES Syntax</a><br />
			<li /> <a  href="60.html">USE Syntax</a><br />
			<li /> <a  href="61.html">LOCK Syntax</a><br />
			<li /> <a  href="62.html">UNLOCK Syntax</a><br />
			<li /> <a  href="63.html">IS LOCKED Syntax</a><br />
			<li /> <a  href="64.html">CREATE TABLE Syntax</a><br />
			<li /> <a  href="65.html">DROP TABLE Syntax</a><br />
			<li /> <a  href="66.html">SHOW TABLES Syntax</a><br />
			<li /> <a  href="67.html">DESCRIBE Syntax</a><br />
			<li /> <a  href="68.html">SHOW USERS Syntax</a><br />
			<li /> <a  href="69.html">GRANT PERMISSIONS Syntax</a><br />
			<li /> <a  href="70.html">Column Properties</a><br />
			<li /> <a  href="71.html">Column Types</a><br />
			<li /> <a  href="72.html">LIMIT Syntax</a><br />
			<li /> <a  href="73.html">ORDERBY Syntax</a><br />
			<li /> <a  href="74.html">WHERE Syntax</a><br />
			<br />

		</td>
	</tr>
	<tr>
		<td colspan="2" class="notices" align="center">
			[ txtSQL Documentation powered by <a href="http://chibiguy.dotgeek.org" target="_blank">txtSQL</a> | 6 SQL Queries ]
		</td>
	</tr>
</table>

</body>
</html>